﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.Entities.Interface;
using PPI.Entities;
using PPI.Mobile;

namespace PPI.ServiceLogic.Distribution
{
    public class LSettings : IMobileTable
    {
        public EUtility Utility { get; set; }

        #region IMobileTable Members

        public List<PPI.Mobile.EMobileQuery> CreateInsertMobileQuery(string connectionKey)
        {
            List<EMobileQuery> listQueries = new List<EMobileQuery>();

            if (Utility != null)
            {
                listQueries.Add(new EMobileQuery("Delete tb_Settings WHERE SettingKey = 2")); //Delete Utility 
                listQueries.Add(new EMobileQuery("insert into tb_Settings (SettingKey, SettingName, SettingValue) values (2,'" + Utility.Name + "', " + Utility.Id + ")")); //Add again
            }

            return listQueries;
        }

        #endregion
    }
}
